import { ColumnsType } from "@/components";

/**
 * Table 字段对应 Label
 */
export enum TableLabel {
    Id = "记录ID",
    Name = "菜式名称",
    Code = "菜式编码",
    CookParams = "烹饪参数",
    CreatedAt = "创建时间",
    UpdatedAt = "更新时间",
}

export const columns: ColumnsType[] = [
    {
        minWidth: 100,
        label: TableLabel.Id,
        prop: "Id"
    },
    {
        minWidth: 120,
        label: TableLabel.Name,
        prop: "Name"
    },
    {
        minWidth: 120,
        label: TableLabel.Code,
        prop: "Code"
    },
    {
        minWidth: 120,
        label: TableLabel.CookParams,
        prop: "CookParams"
    },
    {
        width: 180,
        DateFormat: true,
        sortable: true,
        label: TableLabel.CreatedAt,
        prop: "CreatedAt"
    },
    {
        width: 180,
        DateFormat: true,
        sortable: true,
        label: TableLabel.UpdatedAt,
        prop: "UpdatedAt"
    },
    {
        fixed: "right",
        width: 180,
        label: "操作",
        prop: "",
        Slots: {
            default: "operate"
        }
    }
]